#ifndef	__BASEMATH_H__
#define	__BASEMATH_H__

#include "BasicType/BasicType_1.h"

namespace GCRE {
	namespace Math {
	
		//	Constants
		const BasicType::SFFloat infinite = 3.402823466e+38F;
		const BasicType::SFFloat pi = 3.14159265358979323846F;
		const BasicType::SFFloat half_pi = 0.5F * pi;
		const BasicType::SFFloat two_pi = 2.0F * pi;

		//	Degree to Radian and back
		inline BasicType::SFFloat DegreeToRadian( BasicType::SFFloat degree ) { return degree * pi / 180.0F; }
		inline BasicType::SFFloat RadianToDegree( BasicType::SFFloat rad ) { return rad * 180.0F / pi; }
		
		//	Trigonometric operations
		BasicType::SFFloat cos( BasicType::SFFloat rad );
		BasicType::SFFloat sin( BasicType::SFFloat rad );
		BasicType::SFFloat tan( BasicType::SFFloat rad );
		BasicType::SFFloat arccos( BasicType::SFFloat value );
		BasicType::SFFloat arcsin( BasicType::SFFloat value );
		BasicType::SFFloat arctan( BasicType::SFFloat value );

		//	Exponential operations
		BasicType::SFFloat InvSqrt( BasicType::SFFloat value );
		BasicType::SFFloat sqrt( BasicType::SFFloat value );
		BasicType::SFFloat abs( BasicType::SFFloat value );
		BasicType::SFFloat pow2( BasicType::SFFloat value );
		BasicType::SFFloat round( BasicType::SFFloat value );

		inline BasicType::SFFloat pow( BasicType::SFFloat value, BasicType::SFFloat e ) { return ::pow( value, e ); }
		inline BasicType::SFFloat floor( BasicType::SFFloat value ) { return ::floor( value ); }
		inline BasicType::SFFloat ceil( BasicType::SFFloat value ) { return ::ceil( value ); }
	}
}

#endif	//	__BASEMATH_H__